(function(i,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):t((i=typeof globalThis<"u"?globalThis:i||self).TradingView={})})(this,function(i){"use strict";var t,J,q,K,Z,F,Q,f,l,d,Y,g,X,ee,te,h,ie,oe,re,ne,ae,se,v,le,de,ce,he,ge,ue,T,Ce,b,Se,M,pe,me,u,C,ye,_e,I,Te,be,S,Pe,B,Le,x,Ae,we,fe,ve,Ie,Oe,Re,s,N,O,De,Ve,r,ke,Ee,R,D;(t=i.ActionId||(i.ActionId={})).UnknownAction="UnknownAction",t.Spinner="Spinner",t.Loading="Loading",t.AlertAdd="Alert.Add",t.AlertEdit="Alert.Edit",t.AlertsClone="Alerts.Clone",t.AlertsRemove="Alerts.Remove",t.AlertsRemoveAll="Alerts.RemoveAll",t.AlertsRemoveFiltered="Alerts.RemoveFiltered",t.AlertsRemoveAllInactive="Alerts.RemoveAllInactive",t.AlertsRemoveFires="Alerts.RemoveFires",t.AlertsRestart="Alerts.Restart",t.AlertsRestartAllInactive="Alerts.RestartAllInactive",t.AlertsRestartFilteredInactive="Alerts.RestartFilteredInactive",t.AlertsStop="Alerts.Stop",t.AlertsStopAll="Alerts.StopAll",t.AlertsStopFilteredActive="Alerts.StopFilteredActive",t.AlertsExportFiresToCSV="Alerts.ExportFiresToCSV",t.AlertsLogClear="AlertsLog.Clear",t.ChartAddIndicatorToAllCharts="Chart.AddIndicatorToAllCharts",t.ChartAddSymbolToWatchList="Chart.AddSymbolToWatchList",t.ChartAlertLabelToggleExtendLines="Chart.AlertLabel.ToggleExtendLines",t.ChartApplyIndicatorsToAllCharts="Chart.ApplyIndicatorsToAllCharts",t.ChartIndicatorApplyChildIndicator="Chart.Indicator.ApplyChildIndicator",t.ChartIndicatorApplyFinancials="Chart.Indicator.ApplyFinancials",t.ChartIndicatorAbout="Chart.Indicator.About",t.ChartIndicatorPineLogs="Chart.Indicator.PineLogs",t.ChartIndicatorPineSource="Chart.Indicator.PineSource",t.ChartIndicatorAddFavorites="Chart.Indicator.AddFavorites",t.ChartChangeTimeZone="Chart.ChangeTimeZone",t.ChartClipboardCopyPrice="Chart.Clipboard.CopyPrice",t.ChartClipboardCopyLineTools="Chart.Clipboard.CopyLineTools",t.ChartClipboardCopySource="Chart.Clipboard.CopySource",t.ChartClipboardPasteSource="Chart.Clipboard.PasteSource",t.ChartCrosshairLockVerticalCursor="Chart.Crosshair.LockVerticalCursor",t.ChartCrosshairPlusButtonDrawHorizontalLine="Chart.Crosshair.PlusButton.DrawHorizontalLine",t.ChartCustomActionId="Chart.CustomActionId",t.ChartDialogsShowChangeInterval="Chart.Dialogs.ShowChangeInterval",t.ChartDialogsShowChangeSymbol="Chart.Dialogs.ShowChangeSymbol",t.ChartDialogsShowCompareOrAddSymbol="Chart.Dialogs.ShowCompareOrAddSymbol",t.ChartDialogsShowGeneralSettings="Chart.Dialogs.ShowGeneralSettings",t.ChartDialogsShowGeneralSettingsLegendTab="Chart.Dialogs.ShowGeneralSettings.LegendTab",t.ChartDialogsShowGeneralSettingsSymbolTab="Chart.Dialogs.ShowGeneralSettings.SymbolTab",t.ChartDialogsShowGeneralScalesTab="Chart.Dialogs.ShowGeneralSettings.ScalesTab",t.ChartDialogsShowGeneralSettingsEventsAndAlertsTab="Chart.Dialogs.ShowGeneralSettings.EventsAndAlertsTab",t.ChartDialogsShowGoToDate="Chart.Dialogs.ShowGoToDate",t.ChartDialogsShowInsertIndicators="Chart.Dialogs.ShowInsertIndicators",t.ChartDialogsShowInsertFinancials="Chart.Dialogs.ShowInsertFinancials",t.ChartDialogsShowSymbolInfo="Chart.Dialogs.ShowSymbolInfo",t.ChartDrawingToolbarToggleVisibility="Chart.DrawingToolbar.ToggleVisibility",t.ChartExternalActionId="Chart.ExternalActionId",t.ChartFavoriteDrawingToolsToolbarHide="Chart.FavoriteDrawingToolsToolbar.Hide",t.ChartIndicatorShowSettingsDialog="Chart.Indicator.ShowSettingsDialog",t.ChartLegendToggleLastDayChangeValuesVisibility="Chart.Legend.ToggleLastDayChangeValuesVisibility",t.ChartLinkingGroupSync="Chart.LinkingGroupSync",t.ChartLinkingGroupSyncChangeGroup="Chart.LinkingGroupSync.ChangeGroup",t.ChartLegendToggleBarChangeValuesVisibility="Chart.Legend.ToggleBarChangeValuesVisibility",t.ChartLegendTogglePriceSourceVisibility="Chart.Legend.TogglePriceSourceVisibility",t.ChartLegendToggleIndicatorArgumentsVisibility="Chart.Legend.ToggleIndicatorArgumentsVisibility",t.ChartLegendToggleIndicatorTitlesVisibility="Chart.Legend.ToggleIndicatorTitlesVisibility",t.ChartLegendToggleIndicatorValuesVisibility="Chart.Legend.ToggleIndicatorValuesVisibility",t.ChartLegendToggleOhlcValuesVisibility="Chart.Legend.ToggleOhlcValuesVisibility",t.ChartLegendToggleOpenMarketStatusVisibility="Chart.Legend.ToggleOpenMarketStatusVisibility",t.ChartLegendToggleSymbolVisibility="Chart.Legend.ToggleSymbolVisibility",t.ChartLegendToggleVolumeVisibility="Chart.Legend.ToggleVolumeVisibility",t.ChartLines="Chart.Lines",t.ChartLinesToggleBidAskLinesVisibility="Chart.Lines.ToggleBidAskLinesVisibility",t.ChartLinesToggleHighLowLinesVisibility="Chart.Lines.ToggleHighLowLinesVisibility",t.ChartLinesToggleAverageLineVisibility="Chart.Lines.ToggleAverageLineVisibility",t.ChartLinesTogglePrePostMarketLineVisibility="Chart.Lines.TogglePrePostMarketLineVisibility",t.ChartLinesTogglePrePostMarketPriceLineVisibility="Chart.Lines.TogglePrePostMarketPriceLineVisibility",t.ChartLinesToggleSeriesPrevCloseLineVisibility="Chart.Lines.ToggleSeriesPrevCloseLineVisibility",t.ChartLinesToggleSeriesPriceLineVisibility="Chart.Lines.ToggleSeriesPriceLineVisibility",t.ChartLineToolBarsPatternToggleFlipped="Chart.LineTool.BarsPattern.ToggleFlipped",t.ChartLineToolBarsPatternToggleMirrored="Chart.LineTool.BarsPattern.ToggleMirrored",t.ChartLineToolClone="Chart.LineTool.Clone",t.ChartLineToolCreateLimitOrderFromState="Chart.LineTool.CreateLimitOrderFromState",t.ChartLineToolElliotChangeDegreeProperty="Chart.LineTool.Elliot.ChangeDegreeProperty",t.ChartLineToolNoSync="Chart.LineTool.NoSync",t.ChartLineToolPitchforkChangeTypeToInside="Chart.LineTool.Pitchfork.ChangeTypeToInside",t.ChartLineToolPitchforkChangeTypeToModifiedSchiff="Chart.LineTool.Pitchfork.ChangeTypeToModifiedSchiff",t.ChartLineToolPitchforkChangeTypeToOriginal="Chart.LineTool.Pitchfork.ChangeTypeToOriginal",t.ChartLineToolPitchforkChangeTypeToSchiff="Chart.LineTool.Pitchfork.ChangeTypeToSchiff",t.ChartLineToolSyncInLayout="Chart.LineTool.SyncInLayout",t.ChartLineToolSyncGlobally="Chart.LineTool.SyncGlobally",t.ChartLineToolTemplates="Chart.LineTool.Templates",t.ChartLineToolTemplatesApply="Chart.LineTool.Templates.Apply",t.ChartLineToolTemplatesApplyDefaults="Chart.LineTool.Templates.ApplyDefaults",t.ChartLineToolTemplatesSaveAs="Chart.LineTool.Templates.SaveAs",t.ChartLineToolToolbarChangeFontSizeProperty="Chart.LineTool.Toolbar.ChangeFontSizeProperty",t.ChartLineToolToolbarChangeLineStyleToDashed="Chart.LineTool.Toolbar.ChangeLineStyleToDashed",t.ChartLineToolToolbarChangeLineStyleToDotted="Chart.LineTool.Toolbar.ChangeLineStyleToDotted",t.ChartLineToolToolbarChangeLineStyleToSolid="Chart.LineTool.Toolbar.ChangeLineStyleToSolid",t.ChartMarksToggleVisibility="Chart.Marks.ToggleVisibility",t.ChartMoveChartInLayout="Chart.MoveChartInLayout",t.ChartMoveChartInLayoutBack="Chart.MoveChartInLayout.Back",t.ChartMoveChartInLayoutForward="Chart.MoveChartInLayout.Forward",t.ChartTpoResetAllMergesAndSplits="Chart.TPO.ResetAllMergesAndSplits",t.ChartTpoSplitBlock="Chart.TPO.SplitBlock",t.ChartTpoMergeBlock="Chart.TPO.MergeBlock",t.ChartObjectTreeShow="Chart.ObjectTree.Show",t.ChartDataWindowShow="Chart.DataWindow.Show",t.ChartPaneControlsDeletePane="Chart.PaneControls.DeletePane",t.ChartPaneControlsMaximizePane="Chart.PaneControls.MaximizePane",t.ChartPaneControlsMinimizePane="Chart.PaneControls.MinimizePane",t.ChartPaneControlsMovePaneDown="Chart.PaneControls.MovePaneDown",t.ChartPaneControlsMovePaneUp="Chart.PaneControls.MovePaneUp",t.ChartPaneControlsCollapsePane="Chart.PaneControls.CollapsePane",t.ChartPaneControlsRestorePane="Chart.PaneControls.RestorePane",t.ChartPriceScaleLabels="Chart.PriceScale.Labels",t.ChartPriceScaleLabelsToggleBidAskLabelsVisibility="Chart.PriceScale.Labels.ToggleBidAskLabelsVisibility",t.ChartPriceScaleLabelsToggleHighLowPriceLabelsVisibility="Chart.PriceScale.Labels.ToggleHighLowPriceLabelsVisibility",t.ChartPriceScaleLabelsToggleAveragePriceLabelVisibility="Chart.PriceScale.Labels.ToggleAveragePriceLabelVisibility",t.ChartPriceScaleLabelsToggleIndicatorsNameLabelsVisibility="Chart.PriceScale.Labels.ToggleIndicatorsNameLabelsVisibility",t.ChartPriceScaleLabelsToggleIndicatorsValueLabelsVisibility="Chart.PriceScale.Labels.ToggleIndicatorsValueLabelsVisibility",t.ChartPriceScaleLabelsTogglePrePostMarketLabelsVisibility="Chart.PriceScale.Labels.TogglePrePostMarketLabelsVisibility",t.ChartPriceScaleLabelsToggleNoOverlappingLabelsVisibility="Chart.PriceScale.Labels.ToggleNoOverlappingLabelsVisibility",t.ChartPriceScaleLabelsToggleSeriesLastValueVisibility="Chart.PriceScale.Labels.ToggleSeriesLastValueVisibility",t.ChartPriceScaleLabelsToggleSymbolNameLabelsVisibility="Chart.PriceScale.Labels.ToggleSymbolNameLabelsVisibility",t.ChartPriceScaleLabelsToggleSymbolPrevCloseValueVisibility="Chart.PriceScale.Labels.ToggleSymbolPrevCloseValueVisibility",t.ChartPriceScaleMergeAllScales="Chart.PriceScale.MergeAllScales",t.ChartPriceScaleMergeAllScalesToLeft="Chart.PriceScale.MergeAllScalesToLeft",t.ChartPriceScaleMergeAllScalesToRight="Chart.PriceScale.MergeAllScalesToRight",t.ChartPriceScaleMoveToLeft="Chart.PriceScale.MoveToLeft",t.ChartPriceScaleMoveToRight="Chart.PriceScale.MoveToRight",t.ChartPriceScaleReset="Chart.PriceScale.Reset",t.ChartPriceScaleToggleAddOrderPlusButtonVisibility="Chart.PriceScale.ToggleAddOrderPlusButtonVisibility",t.ChartPriceScaleToggleAutoScale="Chart.PriceScale.ToggleAutoScale",t.ChartPriceScaleToggleAutoScaleSeriesOnly="Chart.PriceScale.ToggleAutoScaleSeriesOnly",t.ChartPriceScaleToggleCountdownToBarCloseVisibility="Chart.PriceScale.ToggleCountdownToBarCloseVisibility",t.ChartPriceScaleToggleIndexedTo100="Chart.PriceScale.ToggleIndexedTo100",t.ChartPriceScaleToggleInvertScale="Chart.PriceScale.ToggleInvertScale",t.ChartPriceScaleToggleLogarithmic="Chart.PriceScale.ToggleLogarithmic",t.ChartPriceScaleTogglePercentage="Chart.PriceScale.TogglePercentage",t.ChartPriceScaleToggleRegular="Chart.PriceScale.ToggleRegular",t.ChartRedo="Chart.Redo",t.ChartRemoveAllIndicators="Chart.RemoveAllIndicators",t.ChartRemoveAllIndicatorsAndLineTools="Chart.RemoveAllIndicatorsAndLineTools",t.ChartRemoveAllLineTools="Chart.RemoveAllLineTools",t.ChartScalesReset="Chart.Scales.Reset",t.ChartScalesToggleLockPriceToBarRatio="Chart.Scales.ToggleLockPriceToBarRatio",t.ChartScrollToLineTool="Chart.ScrollToLineTool",t.ChartSelectedObjectHide="Chart.SelectedObject.Hide",t.ChartSelectedObjectRemove="Chart.SelectedObject.Remove",t.ChartSelectedObjectShow="Chart.SelectedObject.Show",t.ChartSelectedObjectShowSettingsDialog="Chart.SelectedObject.ShowSettingsDialog",t.ChartSelectedObjectToggleLocked="Chart.SelectedObject.ToggleLocked",t.ChartSeriesPriceScaleToggleAutoScale="Chart.Series.PriceScale.ToggleAutoScale",t.ChartSeriesPriceScaleToggleIndexedTo100="Chart.Series.PriceScale.ToggleIndexedTo100",t.ChartSeriesPriceScaleToggleInvertPriceScale="Chart.Series.PriceScale.ToggleInvertPriceScale",t.ChartSeriesPriceScaleToggleLogarithmic="Chart.Series.PriceScale.ToggleLogarithmic",t.ChartSeriesPriceScaleTogglePercentage="Chart.Series.PriceScale.TogglePercentage",t.ChartSeriesPriceScaleToggleRegular="Chart.Series.PriceScale.ToggleRegular",t.ChartSessionBreaksToggleVisibility="Chart.SessionBreaks.ToggleVisibility",t.ChartSetSession="Chart.SetSession",t.ChartSourceChangePriceScale="Chart.Source.ChangePriceScale",t.ChartSourceMergeDown="Chart.Source.MergeDown",t.ChartSourceMergeUp="Chart.Source.MergeUp",t.ChartSourceMoveToNoScale="Chart.Source.MoveToNoScale",t.ChartSourceMoveToOtherScale="Chart.Source.MoveToOtherScale",t.ChartSourceMoveToPane="Chart.Source.MoveToPane",t.ChartSourceUnmergeDown="Chart.Source.UnmergeDown",t.ChartSourceUnmergeUp="Chart.Source.UnmergeUp",t.ChartSourceVisualOrder="Chart.Source.VisualOrder",t.ChartSourceVisualOrderBringForward="Chart.Source.VisualOrder.BringForward",t.ChartSourceVisualOrderBringToFront="Chart.Source.VisualOrder.BringToFront",t.ChartSourceVisualOrderSendBackward="Chart.Source.VisualOrder.SendBackward",t.ChartSourceVisualOrderSendToBack="Chart.Source.VisualOrder.SendToBack",t.ChartSourceResetInputPoints="Chart.Source.ResetInputPoints",t.ChartThemeApply="Chart.Theme.Apply",t.ChartThemeApplyCustom="Chart.Theme.Apply.Custom",t.ChartThemeSaveAs="Chart.Theme.SaveAs",t.ChartTimeScaleReset="Chart.TimeScale.Reset",t.ChartUndo="Chart.Undo",t.ChartShowAllIdeas="Chart.ShowAllIdeas",t.ChartShowIdeasOfFollowedUsers="Chart.ShowIdeasOfFollowedUsers",t.ChartShowMyIdeasOnly="Chart.ShowMyIdeasOnly",t.ChartToggleVisibilityAllLineTools="Chart.ToggleVisibility.AllLineTools",t.ChartToggleVisibilityContinuousContractSwitch="Chart.ToggleVisibility.ContinuousContractSwitch",t.ChartToggleVisibilityContractExpiration="Chart.ToggleVisibility.ContractExpiration",t.ChartToggleVisibilityDividends="Chart.ToggleVisibility.Dividends",t.ChartToggleVisibilityEarnings="Chart.ToggleVisibility.Earnings",t.ChartToggleVisibilityEconomicEvents="Chart.ToggleVisibility.EconomicEvents",t.ChartToggleVisibilitySplits="Chart.ToggleVisibility.Splits",t.ChartToggleVisibilityLatestNewsAndMinds="Chart.ToggleVisibility.LatestNewsAndMinds",t.ChartSourceIntervalsVisibility="Chart.Source.IntervalsVisibility",t.ChartSourceIntervalsVisibilityCurrentAndAbove="Chart.Source.IntervalsVisibility.CurrentAndAbove",t.ChartSourceIntervalsVisibilityCurrentAndBelow="Chart.Source.IntervalsVisibility.CurrentAndBelow",t.ChartSourceIntervalsVisibilityOnlyCurrent="Chart.Source.IntervalsVisibility.Current",t.ChartSourceIntervalsVisibilityAll="Chart.Source.IntervalsVisibility.All",t.NoteCreate="Note.Create",t.NoteEdit="Note.Edit",t.NoteRemove="Note.Remove",t.ObjectsTreeCreateGroup="ObjectsTree.CreateGroup",t.ObjectsTreeRemoveItem="ObjectsTree.RemoveItem",t.ObjectsTreeRenameItem="ObjectsTree.RenameItem",t.ObjectsTreeToggleItemLocked="ObjectsTree.ToggleItemLocked",t.ObjectsTreeToggleItemVisibility="ObjectsTree.ToggleItemVisibility",t.PineEditorConsoleCopyMessage="PineEditor.Console.CopyMessage",t.PineEditorConsoleToggleVisibility="PineEditor.Console.ToggleVisibility",t.PineEditorConsoleClear="PineEditor.Console.Clear",t.ScreenerAddSymbolToCompare="Screener.AddSymbolToCompare",t.ScreenerColumnRemove="Screener.Column.Remove",t.ScreenerFilterChange="Screener.Filter.Change",t.ScreenerFilterReset="Screener.Filter.Reset",t.ScreenerOpenSymbolChart="Screener.OpenSymbolChart",t.ScreenerOpenSymbolOverview="Screener.OpenSymbolOverview",t.ScreenerToggleVisibilityCurrency="Screener.ToggleVisibility.Currency",t.ScreenerToggleVisibilityDescription="Screener.ToggleVisibility.Description",t.ScreenerToggleVisibilityRating="Screener.ToggleVisibility.Rating",t.ScreenerToggleVisibilitySymbolType="Screener.ToggleVisibility.SymbolType",t.TradingCancelOrder="Trading.CancelOrder",t.TradingClosePosition="Trading.ClosePosition",t.TradingCustomActionId="Trading.CustomActionId",t.TradingDOMPlaceLimitOrder="Trading.DOMPlaceLimitOrder",t.TradingDOMPlaceMarketOrder="Trading.DOMPlaceMarketOrder",t.TradingDOMPlaceStopLimitOrder="Trading.DOMPlaceStopLimitOrder",t.TradingDOMPlaceStopOrder="Trading.DOMPlaceStopOrder",t.TradingEditOrder="Trading.EditOrder",t.TradingModifyPosition="Trading.ModifyPosition",t.TradingReversePosition="Trading.ReversePosition",t.TradingSellBuyButtonsToggleVisibility="Trading.SellBuyButtonsToggleVisibility",t.TradingTradeFromChart="Trading.TradeFromChart",t.TradingNoOverlapMode="Trading.NoOverlapMode",t.TradingShowSelectBrokerPanel="Trading.ShowSelectBrokerPanel",t.TradingOrderTitle="Trading.OrderTitle",t.TradingPositionTitle="Trading.PositionTitle",t.WatchlistActions="Watchlist.Actions",t.WatchlistAddSelectedSymbolsToCompare="Watchlist.AddSelectedSymbolsToCompare ",t.WatchlistAddSymbolToCompare="Watchlist.AddSymbolToCompare",t.WatchlistAddSymbolToSection="Watchlist.AddSymbolToSection",t.WatchlistChangeFlaggedGroupColor="Watchlist.ChangeFlaggedGroupColor",t.WatchlistAddSymbol="Watchlist.AddSymbol",t.WatchlistCreate="Watchlist.Create",t.WatchlistAddSelectedSymbols="Watchlist.AddSelectedSymbols",t.WatchlistAddSelectedSymbolsLists="Watchlist.AddSelectedSymbols.Lists",t.WatchlistGetDisplayedTickerDescription="Watchlist.GetDisplayedTickerDescription",t.WatchlistCreateSection="Watchlist.CreateSection",t.WatchlistFlagSelectedSymbols="Watchlist.FlagSelectedSymbols",t.WatchlistFlagSymbol="Watchlist.FlagSymbol",t.WatchlistOpenSymbolChart="Watchlist.OpenSymbolChart",t.WatchlistOpenSymbolOverview="Watchlist.OpenSymbolOverview",t.WatchlistRemoveSection="Watchlist.RemoveSection",t.WatchlistRemoveSymbol="Watchlist.RemoveSymbol",t.WatchlistRenameSection="Watchlist.RenameSection",t.WatchlistUnflagAllSymbols="Watchlist.UnflagAllSymbols",t.WatchlistUnflagSelectedSymbols="Watchlist.UnflagSelectedSymbols",t.WatchlistUnflagSymbol="Watchlist.UnflagSymbol",function(e){e.extractErrorReason=function(o){return o.params[1]}}(J||(J={})),function(e){e.Default="default",e.FullSingleSession="full_single_session"}(q||(q={})),(K=i.TimeFrameType||(i.TimeFrameType={})).PeriodBack="period-back",K.TimeRange="time-range",function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(Z||(Z={})),(F=i.MarketStatus||(i.MarketStatus={})).Open="market",F.Pre="pre_market",F.Post="post_market",F.Close="out_of_session",F.Holiday="holiday",(Q=i.MenuItemType||(i.MenuItemType={})).Separator="separator",Q.Action="action",(f=i.ClearMarksMode||(i.ClearMarksMode={}))[f.All=0]="All",f[f.BarMarks=1]="BarMarks",f[f.TimeScaleMarks=2]="TimeScaleMarks",(l=i.LineStudyPlotStyle||(i.LineStudyPlotStyle={}))[l.Line=0]="Line",l[l.Histogram=1]="Histogram",l[l.Cross=3]="Cross",l[l.Area=4]="Area",l[l.Columns=5]="Columns",l[l.Circles=6]="Circles",l[l.LineWithBreaks=7]="LineWithBreaks",l[l.AreaWithBreaks=8]="AreaWithBreaks",l[l.StepLine=9]="StepLine",l[l.StepLineWithDiamonds=10]="StepLineWithDiamonds",l[l.StepLineWithBreaks=11]="StepLineWithBreaks",(d=i.StudyPlotType||(i.StudyPlotType={})).Line="line",d.Colorer="colorer",d.BarColorer="bar_colorer",d.BgColorer="bg_colorer",d.TextColorer="text_colorer",d.OhlcColorer="ohlc_colorer",d.CandleWickColorer="wick_colorer",d.CandleBorderColorer="border_colorer",d.UpColorer="up_colorer",d.DownColorer="down_colorer",d.Shapes="shapes",d.Chars="chars",d.Arrows="arrows",d.Data="data",d.DataOffset="dataoffset",d.OhlcOpen="ohlc_open",d.OhlcHigh="ohlc_high",d.OhlcLow="ohlc_low",d.OhlcClose="ohlc_close",function(e){e.AlertCondition="alertcondition"}(Y||(Y={})),(g=i.StudyPlotDisplayTarget||(i.StudyPlotDisplayTarget={}))[g.None=0]="None",g[g.Pane=1]="Pane",g[g.DataWindow=2]="DataWindow",g[g.PriceScale=4]="PriceScale",g[g.StatusLine=8]="StatusLine",g[g.All=15]="All",function(e){e[e.None=0]="None",e[e.Pane=1]="Pane",e[e.DataWindow=2]="DataWindow",e[e.PriceScale=4]="PriceScale",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(X||(X={})),(ee=i.OhlcStudyPlotStyle||(i.OhlcStudyPlotStyle={})).OhlcBars="ohlc_bars",ee.OhlcCandles="ohlc_candles",function(e){e.Auto="auto",e.Tiny="tiny",e.Small="small",e.Normal="normal",e.Large="large",e.Huge="huge"}(te||(te={})),(h=i.StudyInputType||(i.StudyInputType={})).Integer="integer",h.Float="float",h.Price="price",h.Bool="bool",h.Text="text",h.Symbol="symbol",h.Session="session",h.Source="source",h.Resolution="resolution",h.Time="time",h.BarTime="bar_time",h.Color="color",h.Textarea="text_area",function(e){e[e.None=0]="None",e[e.DataWindow=2]="DataWindow",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(ie||(ie={})),function(e){e.InitialCapital="initial_capital",e.Currency="currency",e.DefaultQTYValue="default_qty_value",e.DefaultQTYType="default_qty_type",e.Pyramiding="pyramiding",e.ComissionValue="commission_value",e.ComissionType="commission_type",e.BacktestFillLimitsAssumtion="backtest_fill_limits_assumption",e.Slippage="slippage",e.CalcOnOrderFills="calc_on_order_fills",e.CalcOnEveryTick="calc_on_every_tick",e.MarginLong="margin_long",e.MarginShort="margin_short",e.UseBarMagnifier="use_bar_magnifier",e.ProcessOrdersOnClose="process_orders_on_close",e.FillOrdersOnStandardOHLC="fill_orders_on_standard_ohlc"}(oe||(oe={})),function(e){e.Fixed="fixed",e.CashPerOrder="cash_per_order",e.PercentOfEquity="percent_of_equity"}(re||(re={})),function(e){e.Percent="percent",e.CashPerContract="cash_per_contract",e.CashPerOrder="cash_per_order"}(ne||(ne={})),function(e){e.FirstBar="first_visible_bar_time",e.LastBar="last_visible_bar_time",e.Realtime="subscribeRealtime"}(ae||(ae={})),function(e){e.FgColor="__chart_fgcolor",e.BgColor="__chart_bgcolor"}(se||(se={})),(v=i.StudyTargetPriceScale||(i.StudyTargetPriceScale={}))[v.Right=0]="Right",v[v.Left=1]="Left",v[v.NoScale=2]="NoScale",function(e){e[e.Right=0]="Right",e[e.Left=1]="Left",e[e.None=2]="None"}(le||(le={})),(de=i.FilledAreaType||(i.FilledAreaType={})).TypePlots="plot_plot",de.TypeHlines="hline_hline",function(e){e[e.StopLoss=0]="StopLoss",e[e.TrailingStop=1]="TrailingStop",e[e.GuaranteedStop=2]="GuaranteedStop"}(ce||(ce={})),function(e){e.Symbol="symbol"}(he||(he={})),function(e){e[e.PopUp=0]="PopUp",e[e.Notification=1]="Notification"}(ge||(ge={})),function(e){e[e.CONNECTED=1]="CONNECTED",e[e.CONNECTING=2]="CONNECTING",e[e.DISCONNECTED=3]="DISCONNECTED",e[e.ERROR=4]="ERROR"}(ue||(ue={})),(T=i.ConnectionStatus||(i.ConnectionStatus={}))[T.Connected=1]="Connected",T[T.Connecting=2]="Connecting",T[T.Disconnected=3]="Disconnected",T[T.Error=4]="Error",function(e){e[e.LIMIT=1]="LIMIT",e[e.MARKET=2]="MARKET",e[e.STOP=3]="STOP",e[e.STOPLIMIT=4]="STOPLIMIT"}(Ce||(Ce={})),(b=i.OrderType||(i.OrderType={}))[b.Limit=1]="Limit",b[b.Market=2]="Market",b[b.Stop=3]="Stop",b[b.StopLimit=4]="StopLimit",function(e){e[e.BUY=1]="BUY",e[e.SELL=-1]="SELL"}(Se||(Se={})),(M=i.Side||(i.Side={}))[M.Buy=1]="Buy",M[M.Sell=-1]="Sell",function(e){e[e.CANCELED=1]="CANCELED",e[e.FILLED=2]="FILLED",e[e.INACTIVE=3]="INACTIVE",e[e.PLACING=4]="PLACING",e[e.REJECTED=5]="REJECTED",e[e.WORKING=6]="WORKING"}(pe||(pe={})),function(e){e[e.ALL=0]="ALL",e[e.CANCELED=1]="CANCELED",e[e.FILLED=2]="FILLED",e[e.INACTIVE=3]="INACTIVE",e[e.REJECTED=5]="REJECTED",e[e.WORKING=6]="WORKING"}(me||(me={})),(u=i.OrderStatus||(i.OrderStatus={}))[u.Canceled=1]="Canceled",u[u.Filled=2]="Filled",u[u.Inactive=3]="Inactive",u[u.Placing=4]="Placing",u[u.Rejected=5]="Rejected",u[u.Working=6]="Working",(C=i.OrderStatusFilter||(i.OrderStatusFilter={}))[C.All=0]="All",C[C.Canceled=1]="Canceled",C[C.Filled=2]="Filled",C[C.Inactive=3]="Inactive",C[C.Rejected=5]="Rejected",C[C.Working=6]="Working",function(e){e[e.Order=1]="Order",e[e.Position=2]="Position"}(ye||(ye={})),function(e){e[e.ORDER=1]="ORDER",e[e.POSITION=2]="POSITION"}(_e||(_e={})),(I=i.ParentType||(i.ParentType={}))[I.Order=1]="Order",I[I.Position=2]="Position",I[I.IndividualPosition=3]="IndividualPosition",function(e){e[e.StopLoss=0]="StopLoss",e[e.TakeProfit=1]="TakeProfit",e[e.TrailingStop=2]="TrailingStop",e[e.GuaranteedStop=3]="GuaranteedStop"}(Te||(Te={})),function(e){e[e.LIMITPRICE=1]="LIMITPRICE",e[e.STOPPRICE=2]="STOPPRICE",e[e.TAKEPROFIT=3]="TAKEPROFIT",e[e.STOPLOSS=4]="STOPLOSS"}(be||(be={})),(S=i.OrderTicketFocusControl||(i.OrderTicketFocusControl={}))[S.LimitPrice=1]="LimitPrice",S[S.StopPrice=2]="StopPrice",S[S.TakeProfit=3]="TakeProfit",S[S.StopLoss=4]="StopLoss",S[S.Quantity=5]="Quantity",function(e){e[e.ERROR=0]="ERROR",e[e.SUCCESS=1]="SUCCESS"}(Pe||(Pe={})),(B=i.NotificationType||(i.NotificationType={}))[B.Error=0]="Error",B[B.Success=1]="Success",function(e){e[e.Demo=1]="Demo",e[e.Real=0]="Real"}(Le||(Le={})),(x=i.OrderOrPositionMessageType||(i.OrderOrPositionMessageType={})).Information="information",x.Warning="warning",x.Error="error",function(e){e.Demo="demo",e.Live="live"}(Ae||(Ae={})),function(e){e[e.LogOut=0]="LogOut",e[e.FailedRestoring=1]="FailedRestoring",e[e.Offline=2]="Offline",e[e.APIError=3]="APIError",e[e.TwoFactorRequired=4]="TwoFactorRequired",e[e.CancelAuthorization=5]="CancelAuthorization",e[e.TimeOutForAuthorization=6]="TimeOutForAuthorization",e[e.OauthError=7]="OauthError",e[e.BrokenConnection=8]="BrokenConnection",e[e.FailedSignIn=9]="FailedSignIn"}(we||(we={})),function(e){e[e.None=0]="None",e[e.Pips=1]="Pips",e[e.Ticks=2]="Ticks"}(fe||(fe={})),function(e){e.Halted="HALTED",e.NotShortable="NOT-SHORTABLE",e.HardToBorrow="HARD-TO-BORROW"}(ve||(ve={})),function(e){e[e.Limit=1]="Limit",e[e.Stop=2]="Stop"}(Ie||(Ie={})),function(e){e.Disallowed="disallowed",e.Allowed="allowed",e.AllowedWithWarning="allowed_with_warning"}(Oe||(Oe={})),function(e){e.PlaceOrder="place_order",e.ModifyOrder="modify_order",e.CancelOrder="cancel_order",e.ModifyPosition="modify_position",e.ClosePosition="close_position",e.ModifyIndividualPosition="modify_individual_position",e.CloseIndividualPosition="close_individual_position",e.CloseNetPosition="close_net_position"}(Re||(Re={})),(s=i.StandardFormatterName||(i.StandardFormatterName={})).Date="date",s.DateOrDateTime="dateOrDateTime",s.Default="default",s.Fixed="fixed",s.FixedInCurrency="fixedInCurrency",s.VariablePrecision="variablePrecision",s.FormatQuantity="formatQuantity",s.FormatPrice="formatPrice",s.FormatPriceForexSup="formatPriceForexSup",s.FormatPriceInCurrency="formatPriceInCurrency",s.IntegerSeparated="integerSeparated",s.LocalDate="localDate",s.LocalDateOrDateTime="localDateOrDateTime",s.Percentage="percentage",s.Pips="pips",s.Profit="profit",s.ProfitInInstrumentCurrency="profitInInstrumentCurrency",s.Side="side",s.PositionSide="positionSide",s.Status="status",s.Symbol="symbol",s.Text="text",s.Type="type",s.MarginPercent="marginPercent",s.Empty="empty",(N=i.OverridePriceAxisLastValueMode||(i.OverridePriceAxisLastValueMode={}))[N.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",N[N.LastValueAccordingToScale=1]="LastValueAccordingToScale",(O=i.OverrideLineStyle||(i.OverrideLineStyle={}))[O.Solid=0]="Solid",O[O.Dotted=1]="Dotted",O[O.Dashed=2]="Dashed",function(e){e[e.Offline=0]="Offline",e[e.Resolving=1]="Resolving",e[e.Loading=2]="Loading",e[e.Ready=3]="Ready",e[e.InvalidSymbol=4]="InvalidSymbol",e[e.Snapshot=5]="Snapshot",e[e.EOD=6]="EOD",e[e.Pulse=7]="Pulse",e[e.Delayed=8]="Delayed",e[e.DelayedSteaming=9]="DelayedSteaming",e[e.NoBars=10]="NoBars",e[e.Replay=11]="Replay",e[e.Error=12]="Error",e[e.CalculationError=13]="CalculationError",e[e.UnsupportedResolution=14]="UnsupportedResolution"}(De||(De={})),function(e){e[e.Markers=0]="Markers",e[e.Stepline=1]="Stepline",e[e.Simple=2]="Simple"}(Ve||(Ve={})),(r=i.ChartStyle||(i.ChartStyle={}))[r.Bar=0]="Bar",r[r.Candle=1]="Candle",r[r.Line=2]="Line",r[r.Area=3]="Area",r[r.Renko=4]="Renko",r[r.Kagi=5]="Kagi",r[r.PnF=6]="PnF",r[r.LineBreak=7]="LineBreak",r[r.HeikinAshi=8]="HeikinAshi",r[r.HollowCandle=9]="HollowCandle",r[r.Baseline=10]="Baseline",r[r.Range=11]="Range",r[r.HiLo=12]="HiLo",r[r.Column=13]="Column",r[r.LineWithMarkers=14]="LineWithMarkers",r[r.Stepline=15]="Stepline",r[r.HLCArea=16]="HLCArea",r[r.VolFootprint=17]="VolFootprint",r[r.TPO=18]="TPO",r[r.VolCandle=19]="VolCandle",r[r.SVP=20]="SVP",(ke=i.TimeHoursFormat||(i.TimeHoursFormat={})).TwentyFourHours="24-hours",ke.TwelveHours="12-hours",function(e){e[e.Initial=2]="Initial",e[e.SeriesZOrderIsAlwaysZero=3]="SeriesZOrderIsAlwaysZero",e[e.Current=3]="Current"}(Ee||(Ee={})),(R=i.PlDisplay||(i.PlDisplay={}))[R.Money=0]="Money",R[R.Pips=1]="Pips",R[R.Percentage=2]="Percentage",(D=i.TradedGroupHorizontalAlignment||(i.TradedGroupHorizontalAlignment={}))[D.Left=0]="Left",D[D.Center=1]="Center",D[D.Right=2]="Right",i.PlDisplay.Money,i.PlDisplay.Money,i.TradedGroupHorizontalAlignment.Right;var Fe,We,Me,Be,H,P,n,Ne,Ue,xe,He,p,je,ze,V;function j(e,o){const a={...e};for(const c in o)typeof e[c]!="object"||e[c]===null||Array.isArray(e[c])?o[c]!==void 0&&(a[c]=o[c]):a[c]=j(e[c],o[c]);return a}(function(e){e[e.Background=0]="Background",e[e.Foreground=1]="Foreground",e[e.Topmost=2]="Topmost"})(Fe||(Fe={})),function(e){e[e.Unavailable=0]="Unavailable",e[e.AvailableReadonlyAlwaysDisabled=1]="AvailableReadonlyAlwaysDisabled",e[e.AvailableReadonlyAlwaysEnabled=2]="AvailableReadonlyAlwaysEnabled",e[e.Available=3]="Available"}(We||(We={})),function(e){e[e.ViewportChangeUserAction=0]="ViewportChangeUserAction",e[e.DataUpdate=1]="DataUpdate",e[e.SeriesRestart=2]="SeriesRestart",e[e.SeriesCompleted=3]="SeriesCompleted",e[e.StudyCreation=4]="StudyCreation"}(Me||(Me={})),function(e){e[e.Chart=0]="Chart"}(Be||(Be={})),(H=i.VisibilityType||(i.VisibilityType={})).AlwaysOn="alwaysOn",H.VisibleOnMouseOver="visibleOnMouseOver",H.AlwaysOff="alwaysOff",(P=i.PriceScaleMode||(i.PriceScaleMode={}))[P.Normal=0]="Normal",P[P.Log=1]="Log",P[P.Percentage=2]="Percentage",P[P.IndexedTo100=3]="IndexedTo100",(n=i.SeriesType||(i.SeriesType={}))[n.Bars=0]="Bars",n[n.Candles=1]="Candles",n[n.Line=2]="Line",n[n.Area=3]="Area",n[n.HeikenAshi=8]="HeikenAshi",n[n.HollowCandles=9]="HollowCandles",n[n.Baseline=10]="Baseline",n[n.HiLo=12]="HiLo",n[n.Column=13]="Column",n[n.LineWithMarkers=14]="LineWithMarkers",n[n.Stepline=15]="Stepline",n[n.HLCArea=16]="HLCArea",n[n.VolCandle=19]="VolCandle",n[n.Renko=4]="Renko",n[n.Kagi=5]="Kagi",n[n.PointAndFigure=6]="PointAndFigure",n[n.LineBreak=7]="LineBreak",function(e){e.Value="_seriesId"}(Ne||(Ne={})),(Ue=i.HHistDirection||(i.HHistDirection={})).LeftToRight="left_to_right",Ue.RightToLeft="right_to_left",function(e){e.Relative="relative",e.Absolute="absolute"}(xe||(xe={})),function(e){e.UpDown="Up/Down",e.Total="Total",e.Delta="Delta"}(He||(He={})),(p=i.MarkLocation||(i.MarkLocation={})).AboveBar="AboveBar",p.BelowBar="BelowBar",p.Top="Top",p.Bottom="Bottom",p.Right="Right",p.Left="Left",p.Absolute="Absolute",p.AbsoluteUp="AbsoluteUp",p.AbsoluteDown="AbsoluteDown",function(e){e.Left="left",e.Center="center",e.Right="right"}(je||(je={})),function(e){e.Top="top",e.Middle="middle",e.Bottom="bottom"}(ze||(ze={})),(V=i.LineStyle||(i.LineStyle={}))[V.Solid=0]="Solid",V[V.Dotted=1]="Dotted",V[V.Dashed=2]="Dashed";const Ze={width:800,height:500,interval:"1D",timezone:"Etc/UTC",container:"",library_path:"",locale:"en",widgetbar:{details:!1,watchlist:!1,news:!1,datawindow:!1,watchlist_settings:{default_symbols:[]}},overrides:{"mainSeriesProperties.showCountdown":!1},studies_overrides:{},trading_customization:{position:{},order:{}},brokerConfig:{configFlags:{}},fullscreen:!1,autosize:!1,disabled_features:[],enabled_features:[],debug:!1,logo:{},time_frames:[{text:"5y",resolution:"1W"},{text:"1y",resolution:"1W"},{text:"6m",resolution:"120"},{text:"3m",resolution:"60"},{text:"1m",resolution:"30"},{text:"5d",resolution:"5"},{text:"1d",resolution:"1"}],client_id:"0",user_id:"0",charts_storage_api_version:"1.0",favorites:{intervals:[],chartTypes:[],indicators:[],drawingTools:[]}},Ge=JSON.parse('[{"iso":"ar","dir":"rtl","language":"ar"},{"iso":"pt","dir":"ltr","language":"pt"},{"iso":"ca","dir":"ltr","language":"ca_ES"},{"iso":"cs","dir":"ltr","language":"cs"},{"iso":"de","dir":"ltr","language":"de"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"es","dir":"ltr","language":"es"},{"iso":"fa","dir":"rtl","language":"fa"},{"iso":"fr","dir":"ltr","language":"fr"},{"iso":"he","dir":"rtl","language":"he_IL"},{"iso":"hu","dir":"ltr","language":"hu_HU"},{"iso":"id","dir":"ltr","language":"id_ID"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"it","dir":"ltr","language":"it"},{"iso":"ja","dir":"ltr","language":"ja"},{"iso":"ko","dir":"ltr","language":"ko"},{"iso":"ms","dir":"ltr","language":"ms_MY"},{"iso":"pl","dir":"ltr","language":"pl"},{"iso":"ru","dir":"ltr","language":"ru"},{"iso":"sv","dir":"ltr","language":"sv"},{"iso":"th","dir":"ltr","language":"th"},{"iso":"tr","dir":"ltr","language":"tr"},{"iso":"vi","dir":"ltr","language":"vi"},{"iso":"zh-Hans","dir":"ltr","language":"zh"},{"iso":"zh-Hant","dir":"ltr","language":"zh_TW"},{"iso":"el","dir":"ltr","language":"el"},{"iso":"nl","dir":"ltr","language":"nl_NL"},{"iso":"ro","dir":"ltr","language":"ro"}]');let $e=!1;function Je(){return"CL v28.5.0 (internal id fb6f897f @ 2024-12-18T12:27:11.562Z)"}const Qe=class{constructor(e){var o,a;if(this._id=`tradingview_${(1048576*(1+Math.random())|0).toString(16).substring(1)}`,this._ready=!1,this._readyHandlers=[],this._onWindowResize=this._autoResizeChart.bind(this),!e.datafeed)throw new Error("Datafeed is not defined");!((o=e.overrides)===null||o===void 0)&&o["mainSeriesProperties.priceAxisProperties.lockScale"]&&(console.warn("mainSeriesProperties.priceAxisProperties.lockScale can not be set to true within the widget constructor"),delete e.overrides["mainSeriesProperties.priceAxisProperties.lockScale"]),this._options=j(Ze,e),((a=this._options.theme)!==null&&a!==void 0?a:"light").toLowerCase()==="dark"&&this._options.loading_screen===void 0&&(this._options.loading_screen={backgroundColor:"#131722"}),(this._options.debug||this._options.debug_broker)&&($e||($e=!0,console.log("Using CL v28.5.0 (internal id fb6f897f @ 2024-12-18T12:27:11.562Z)"))),this._innerWindowLoaded=new Promise(c=>{this._innerWindowResolver=c}),this._create()}setDebugMode(e){this._innerAPI().setDebugMode(e)}onChartReady(e){this._ready?e.call(this):this._readyHandlers.push(e)}headerReady(){return this._innerWindowLoaded.then(()=>this._innerWindow().headerReady())}onGrayedObjectClicked(e){this._doWhenInnerApiLoaded(o=>{o.onGrayedObjectClicked(e)})}onShortcut(e,o){this._doWhenInnerWindowLoaded(a=>{a.createShortcutAction(e,o)})}subscribe(e,o){this._doWhenInnerApiLoaded(a=>{a.subscribe(e,o)})}unsubscribe(e,o){this._doWhenInnerApiLoaded(a=>{a.unsubscribe(e,o)})}chart(e){return this._innerAPI().chart(e)}getLanguage(){return this._options.locale}setSymbol(e,o,a){this._innerAPI().changeSymbol(e,o,a)}remove(){window.removeEventListener("resize",this._onWindowResize),this._readyHandlers.splice(0,this._readyHandlers.length),delete window[this._id],this._iFrame.parentNode&&this._iFrame.parentNode.removeChild(this._iFrame)}closePopupsAndDialogs(){this._doWhenInnerApiLoaded(e=>{e.closePopupsAndDialogs()})}selectLineTool(e,o){this._innerAPI().selectLineTool(e,o)}selectedLineTool(){return this._innerAPI().selectedLineTool()}save(e,o){this._innerAPI().saveChart(e,o)}load(e,o){this._innerAPI().loadChart({json:e,extendedData:o})}getSavedCharts(e){this._innerAPI().getSavedCharts(e)}loadChartFromServer(e){this._innerAPI().loadChartFromServer(e)}saveChartToServer(e,o,a){this._innerAPI().saveChartToServer(e,o,a)}removeChartFromServer(e,o){this._innerAPI().removeChartFromServer(e,o)}onContextMenu(e){this._doWhenInnerApiLoaded(o=>{o.onContextMenu(e)})}createButton(e){return this._innerWindow().createButton(e)}createDropdown(e){return this._innerWindow().createDropdown(e)}showNoticeDialog(e){this._doWhenInnerApiLoaded(o=>{o.showNoticeDialog(e)})}showConfirmDialog(e){this._doWhenInnerApiLoaded(o=>{o.showConfirmDialog(e)})}showLoadChartDialog(){this._innerAPI().showLoadChartDialog()}showSaveAsChartDialog(){this._innerAPI().showSaveAsChartDialog()}symbolInterval(){return this._innerAPI().getSymbolInterval()}mainSeriesPriceFormatter(){return this._innerAPI().mainSeriesPriceFormatter()}getIntervals(){return this._innerAPI().getIntervals()}getStudiesList(){return this._innerAPI().getStudiesList()}getStudyInputs(e){return this._innerAPI().getStudyInputs(e)}getStudyStyles(e){return this._innerAPI().getStudyStyles(e)}addCustomCSSFile(e){this._innerWindow().addCustomCSSFile(e)}applyOverrides(e){this._options=j(this._options,{overrides:e}),this._doWhenInnerWindowLoaded(o=>{o.applyOverrides(e)})}applyStudiesOverrides(e){this._doWhenInnerWindowLoaded(o=>{o.applyStudiesOverrides(e)})}watchList(){return this._innerAPI().watchlist()}news(){return this._innerAPI().news()}widgetbar(){return this._innerAPI().widgetbar()}activeChart(){return this._innerAPI().activeChart()}activeChartIndex(){return this._innerAPI().activeChartIndex()}setActiveChart(e){return this._innerAPI().setActiveChart(e)}chartsCount(){return this._innerAPI().chartsCount()}layout(){return this._innerAPI().layout()}setLayout(e){this._innerAPI().setLayout(e)}layoutName(){return this._innerAPI().layoutName()}resetLayoutSizes(e){this._innerAPI().resetLayoutSizes(e)}changeTheme(e,o){return this._innerWindow().changeTheme(e,o)}getTheme(){return this._innerWindow().getTheme()}takeScreenshot(){this._doWhenInnerApiLoaded(e=>{e.takeScreenshot()})}lockAllDrawingTools(){return this._innerAPI().lockAllDrawingTools()}hideAllDrawingTools(){return this._innerAPI().hideAllDrawingTools()}drawOnAllChartsEnabled(){return this._innerAPI().drawOnAllChartsEnabled()}drawOnAllCharts(e){this._innerAPI().drawOnAllCharts(e)}magnetEnabled(){return this._innerAPI().magnetEnabled()}magnetMode(){return this._innerAPI().magnetMode()}undoRedoState(){return this._innerAPI().undoRedoState()}setIntervalLinkingEnabled(e){this._innerAPI().setIntervalLinkingEnabled(e)}setDateRangeLinkingEnabled(e){this._innerAPI().setDateRangeLinkingEnabled(e)}setTimeFrame(e){this._innerAPI().setTimeFrame(e)}symbolSync(){return this._innerAPI().symbolSync()}intervalSync(){return this._innerAPI().intervalSync()}crosshairSync(){return this._innerAPI().crosshairSync()}timeSync(){return this._innerAPI().timeSync()}dateRangeSync(){return this._innerAPI().dateRangeSync()}setFeatureEnabled(e,o){this._innerAPI().setFeatureEnabled(e,o)}getAllFeatures(){return this._innerWindow().getAllFeatures()}clearUndoHistory(){return this._innerAPI().clearUndoHistory()}undo(){return this._innerAPI().undo()}redo(){return this._innerAPI().redo()}startFullscreen(){this._innerAPI().startFullscreen()}exitFullscreen(){this._innerAPI().exitFullscreen()}takeClientScreenshot(e){return this._innerAPI().takeClientScreenshot(e)}navigationButtonsVisibility(){return this._innerWindow().getNavigationButtonsVisibility()}paneButtonsVisibility(){return this._innerWindow().getPaneButtonsVisibility()}dateFormat(){return this._innerWindow().getDateFormat()}timeHoursFormat(){return this._innerWindow().getTimeHoursFormat()}currencyAndUnitVisibility(){return this._innerWindow().getCurrencyAndUnitVisibility()}supportedChartTypes(){return this._innerAPI().supportedChartTypes()}watermark(){return this._innerAPI().watermark()}customSymbolStatus(){return this._innerWindow().customSymbolStatus()}setCSSCustomProperty(e,o){if(e.startsWith("--")===!1)throw new Error("customPropertyName should begin with a double hyphen");this._innerWindow().document.body.style.setProperty(e,o)}getCSSCustomPropertyValue(e){if(e.startsWith("--")===!1)throw new Error("customPropertyName should begin with a double hyphen");const o=this._innerWindow().document.body,a=o.style.getPropertyValue(e);return a||getComputedStyle(o).getPropertyValue(e)}unloadUnusedCharts(){this._innerAPI().unloadUnusedCharts()}async customThemes(){return this._innerWindow().customThemes()}linking(){return this._innerAPI().linking}_innerAPI(){return this._innerWindow().tradingViewApi}_innerWindow(){return this._iFrame.contentWindow}_doWhenInnerWindowLoaded(e){this._ready?e(this._innerWindow()):this._innerWindowLoaded.then(()=>{e(this._innerWindow())})}_doWhenInnerApiLoaded(e){this._doWhenInnerWindowLoaded(o=>{o.doWhenApiIsReady(()=>e(this._innerAPI()))})}_autoResizeChart(){this._options.fullscreen&&(this._iFrame.style.height=window.innerHeight+"px",Ye&&setTimeout(()=>{this._iFrame.style.height=window.innerHeight+"px"},30))}async _create(){var e,o,a,c;const k=(o=(e=this._options.enabled_features)===null||e===void 0?void 0:e.includes("iframe_loading_same_origin"))!==null&&o!==void 0&&o,E=k||(c=(a=this._options.enabled_features)===null||a===void 0?void 0:a.includes("iframe_loading_compatibility_mode"))!==null&&c!==void 0&&c,[z,m]=this._render(!E,k),y=this._options.container,A=typeof y=="string"?document.getElementById(y):y;if(A===null)throw new Error(`There is no such element - #${this._options.container}`);A.innerHTML=z,this._iFrame=A.querySelector(`#${this._id}`);const L=this._iFrame;k&&await this._innerWindowEvent("sameOriginLoad"),E&&(L.contentWindow?(L.contentWindow.document.open(),L.contentWindow.document.write(m),L.contentWindow.document.close()):console.warn("Unable to locate contentWindow for the created iframe. Please try disabling the `iframe_loading_compatibility_mode` featureset.")),this._innerWindow().addEventListener("innerWindowLoad",function(_,w){if(_===void 0)throw new Error(`${w} is undefined`);return _}(this._innerWindowResolver,"_innerWindowResolver"),{once:!0}),(this._options.autosize||this._options.fullscreen)&&(L.style.width="100%",this._options.fullscreen||(L.style.height="100%")),window.addEventListener("resize",this._onWindowResize),this._onWindowResize(),this._innerWindowLoaded.then(()=>{try{this._innerWindow().widgetReady(()=>{this._ready=!0;for(const _ of this._readyHandlers)try{_.call(this)}catch(w){console.error(w)}this._innerWindow().initializationFinished()})}catch(_){if(_ instanceof Error&&/widgetReady is not a function/.test(_.message))throw new Error(`There was an error when loading the library. Usually this error means the library failed to load its static files. Check that the library files are available at ${window.location.host}/${this._options.library_path||""} or correct the library_path option.`)}})}_innerWindowEvent(e){return new Promise(o=>{this._innerWindow().addEventListener(e,o,{once:!0})})}_render(e,o){var a;const c=window;if(c[this._id]={datafeed:this._options.datafeed,customFormatters:this._options.custom_formatters,brokerFactory:this._options.broker_factory,overrides:this._options.overrides,studiesOverrides:this._options.studies_overrides,tradingCustomization:this._options.trading_customization,disabledFeatures:this._options.disabled_features,enabledFeatures:this._options.enabled_features,brokerConfig:this._options.broker_config||this._options.brokerConfig,restConfig:this._options.restConfig,favorites:this._options.favorites,logo:this._options.logo,numeric_formatting:this._options.numeric_formatting,rss_news_feed:this._options.rss_news_feed,rss_news_title:this._options.rss_news_title,newsProvider:this._options.news_provider,loadLastChart:this._options.load_last_chart,saveLoadAdapter:this._options.save_load_adapter,loading_screen:this._options.loading_screen,settingsAdapter:this._options.settings_adapter,getCustomIndicators:this._options.custom_indicators_getter,additionalSymbolInfoFields:this._options.additional_symbol_info_fields,headerWidgetButtonsMode:this._options.header_widget_buttons_mode,customTranslateFunction:this._options.custom_translate_function,symbolSearchComplete:this._options.symbol_search_complete,contextMenu:this._options.context_menu,settingsOverrides:this._options.settings_overrides,timeframe:this._options.timeframe,customTimezones:this._options.custom_timezones,customChartDescriptionFunction:this._options.custom_chart_description_function,customThemes:this._options.custom_themes,imageStorageAdapter:this._options.image_storage_adapter},this._options.saved_data)c[this._id].chartContent={json:this._options.saved_data},this._options.saved_data_meta_info&&(c[this._id].chartContentExtendedData=this._options.saved_data_meta_info);else if(!this._options.load_last_chart&&!this._options.symbol)throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");if(this._options.library_path&&!this._options.library_path.endsWith("/")&&console.warn("library_path option should contain a trailing forward slash"),this._options.locale){const m=encodeURIComponent(this._options.locale);Ge.findIndex(y=>y.language===m)>=0||(console.warn("locale isn't supported. Using default of `en`."),this._options.locale="en")}const k=function(m,y){var A;const L=new URL(`${m||""}`,location.href).href,_=JSON.parse('["bundles/runtime.0c59f90a8699f12ff40f.js","bundles/__LANG__.2312.a9353e46c20c3019a091.js","bundles/9662.03109f673cda5962c847.css","bundles/7346.a2efeed47130dd4e832c.js","bundles/library.8fdacc60e5256d6fcc84.js"]'),w=encodeURIComponent(y),G=(A=Ge.find(U=>U.language===w))!==null&&A!==void 0?A:{iso:"en",dir:"ltr"},Xe=`lang="${G.iso}" dir="${G.dir}"`;return``):W.endsWith(".css")&&Ke.push(``);return[...qe,...Ke].join(` `)}(_,G.dir==="rtl",w)} `,localeLanguage:w,htmlAttrs:Xe,libraryPath:L}).htmlAttrs}>